The regions were derived using a multivariate technique, …
---
title: "Alpine wide snow"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source_code: embed
social: ["menu"]
navbar:
- { title: "CliRSnow project page", href: "/", align: right }
---
```{r setup, include=FALSE}
library(flexdashboard)
library(data.table)
library(magrittr)
library(lubridate)
library(ggplot2)
library(scico)
library(forcats)
library(plotly)
library(cluster)
library(foreach)
library(sf)
library(leaflet)
cols_cluster <- setNames(scales::brewer_pal(palette = "Set1")(5),
c("NW", "NE", "North & high Alpine", "South & high Alpine", "SE"))
```
Station time series
=====================================
```{r stn-ts-data, include=F}
load("/mnt/CEPH_PROJECTS/ALPINE_WIDE_SNOW/PAPER/02_review/rds/trends-01-1971-2019-ols-gls.rda")
dat_meta_clust <- readRDS("/mnt/CEPH_PROJECTS/ALPINE_WIDE_SNOW/PAPER/02_review/rds/meta-with-cluster-01.rds")
# stn_trend <- fs::dir_ls("test-png/") %>% fs::path_file() %>% fs::path_ext_remove()
stn_trend <- sort(unique(c(dat_month_ols$Name, dat_month_gls$Name,
dat_seasonal_gls$Name, dat_seasonal_ols$Name)))
dat_meta_clust[, stn_long := ifelse(Name %in% stn_trend, "trend", "region")]
dat_meta_clust[, leaf_opac := ifelse(Name %in% stn_trend, 0.8, 0.4)]
dat_meta_clust[, leaf_rad := ifelse(Name %in% stn_trend, 6, 4)]
dat_meta_clust[, popup_html := paste0(
Name, "
",
Elevation, "m
",
round(Longitude, 3), "°E ", round(Latitude, 3), "°N
",
'Seasonal snow indices (in new tab)
',
'Monthly mean snow depth (in new tab)
'
)]
sf_meta_clust <- st_as_sf(dat_meta_clust,
coords = c("Longitude", "Latitude"),
crs = 4326)
```
```{r}
leaf_col <- colorFactor("Set1", levels = levels(dat_meta_clust$cluster_fct))
sf_meta_clust %>%
leaflet() %>%
addProviderTiles("Esri.WorldTopoMap") %>%
addCircleMarkers(color = ~leaf_col(cluster_fct),
stroke = F,
radius = ~leaf_rad,
fillOpacity = ~leaf_opac,
popup = ~popup_html)
```
More info
=========================================
### Regions
The regions were derived using a multivariate technique, ...